home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java for 3D & VRML Worlds
/
Java for 3d and VRML Worlds.iso
/
world
/
motion
/
motion.wrl
< prev
next >
Wrap
Text File
|
1996-10-17
|
3KB
|
179 lines
#VRML V2.0 utf8
#
# "Motion Shadow Effect"
# created by ask@krc.sony.co.jp (Masamichi zzzcat Asukai)
#
# Copyright(C) 1996 Sony Corporation. All rights reserved.
#
NavigationInfo {
headlight FALSE
}
Viewpoint {
position 0.0 1.75 30.0
}
Background {
skyColor 0.5 0.3 0.7
}
PROTO P_TREE [
] {
Billboard {
# "axisOfRotaion 0 1 0" doesn't work!
#axisOfRotaion 0 1 0
axisOfRotation 0 0 0
children [
Shape {
appearance Appearance {
texture ImageTexture {
url "tree.gif"
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-0.5 0 0,
0.5 0 0,
0.5 1 0,
-0.5 1 0,
]
}
coordIndex [
0, 1, 2, 3, -1,
]
}
}
]
}
}
PROTO P_SHADOW [
] {
Transform {
rotation 1 0 0 -1.57
children [
Shape {
appearance Appearance {
material Material {
ambientIntensity 0
diffuseColor 0 0 0
transparency 0.3
}
texture ImageTexture {
url "tree.gif"
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-0.5 0 0,
0.5 0 0,
0.5 1 0,
-0.5 1 0,
]
}
coordIndex [
0, 1, 2, 3, -1,
]
}
}
]
}
}
DEF TREE Transform {
translation 0 0 0
scale 3 3 3
children [
P_TREE {}
DEF SHADOW Transform {
children [ P_SHADOW {} ]
}
]
}
DEF LIGHT Transform {
translation -20 10 0
children [
PointLight {
intensity 1.0
}
Shape {
appearance Appearance {
material Material {
ambientIntensity 0
diffuseColor 0 0 0
emissiveColor 1 1 0
}
}
geometry Sphere{
radius 0.5
}
}
]
}
DEF L_TIME TimeSensor{
cycleInterval 10.0
stopTime -1
loop TRUE
}
DEF POSINT PositionInterpolator{
set_fraction 0.5
key [0, 0.25, 0.5, 0.75, 1]
keyValue [-15 10 5, 5 15 5, 5 10 -15, -15 5 -15, -15 10 5]
}
ROUTE L_TIME.fraction_changed TO POSINT.set_fraction
ROUTE POSINT.value_changed TO LIGHT.set_translation
DEF TIME TimeSensor{
cycleInterval 0.2
stopTime -1
loop TRUE
}
DEF SCRIPT Script {
url "motion.class"
eventIn SFTime interval
eventOut SFRotation setRotation
eventOut SFVec3f setScale
field SFNode light USE LIGHT
field SFNode tree USE TREE
}
ROUTE TIME.cycleTime TO SCRIPT.interval
ROUTE SCRIPT.setRotation TO SHADOW.set_rotation
ROUTE SCRIPT.setScale TO SHADOW.set_scale
DEF GROUND Transform {
translation 0 -0.1 0
children[
Shape {
appearance Appearance {
material Material {
diffuseColor 0.6 0.4 0.4
emissiveColor 0.3 0.2 0.2
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-30 0 -30,
-30 0 30,
30 0 30,
30 0 -30,
]
}
coordIndex [
0, 1, 2, 3, -1,
]
}
}
]
}